/*  This file is part of LibGChart.
 *
 * AUTHORS
 *       Sascha Dewald        <sascha.dewald@googlemail.com>
 *
 * Copyright (C) 2009 Sascha Dewald
 *
 *  
 *  
 *  LibGChart is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  Foobar is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with LibGChart.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */


using System;

using LibGChart;

namespace TestChart
{
	
	/**
	 * ConfigWindow
	 */
	public partial class ConfigWindow : Gtk.Window
	{
		private GChart chart;
		
		/**
		 * ConfigWindow
		 */
		public ConfigWindow(GChart chart) : 
				base(Gtk.WindowType.Toplevel)
		{
			this.Build();
			
			this.chart = chart;
			
			this.chart.OffsetChartBottom	= 10;
			this.chart.OffsetChartLeft		= 10;
			this.chart.OffsetChartRight		= 10;
			this.chart.OffsetChartTop		= 10;
			
			this.chart.Title.Text =  entryTitleChart.Text;
			this.chart.Title.FontSize = (int) spinbuttonTitle.Value;
			
			this.chart.Title.set_color(0.0, 0.7, 0.0);
			
			this.chart.axisX.Title.Text = entryTitleX.Text;
			this.chart.axisX.Title.FontSize = (int) spinbuttonTitleX.Value;
			this.chart.axisX.set_color(0.0, 1.0, 0.0);
			
			this.chart.axisY.Title.Text = entryTitleY.Text;
			this.chart.axisY.Title.FontSize = (int) spinbuttonTitleY.Value;
			
			this.chart.axisX.ValueMax = spinbuttonMaxX.Value;
			this.chart.axisY.ValueMax = spinbuttonMaxY.Value;
			
			this.chart.OffsetChartLeft = (int) spinbuttonOffsetLeft.Value;
			this.chart.OffsetChartRight = (int) spinbuttonOffsetRight.Value;
			this.chart.OffsetChartTop = (int) spinbuttonOffsetTop.Value;
			this.chart.OffsetChartBottom = (int) spinbuttonOffsetBottom.Value;
		}
		
		/**
		 * OnEntryTitleChartChanged event
		 */
		protected virtual void OnEntryTitleChartChanged (object sender, System.EventArgs e)
		{
			chart.Title.Text = entryTitleChart.Text;
		}
		
		/**
		 * OnEntryTitleChartChanged event
		 */
		protected virtual void OnEntryTitleXChanged (object sender, System.EventArgs e)
		{
			chart.axisX.Title.Text = entryTitleX.Text;
		}
		
		/**
		 * OnEntryTitleYChanged event
		 */
		protected virtual void OnEntryTitleYChanged (object sender, System.EventArgs e)
		{
			chart.axisY.Title.Text = entryTitleY.Text;
		}
		
		/**
		 * OnSpinbuttonTitleChanged event
		 */
		protected virtual void OnSpinbuttonTitleChanged (object sender, System.EventArgs e)
		{
			chart.Title.FontSize = (int) spinbuttonTitle.Value;
		}
		
		/**
		 * OnSpinbuttonTitleXChanged event
		 */
		protected virtual void OnSpinbuttonTitleXChanged (object sender, System.EventArgs e)
		{
			chart.axisX.Title.FontSize = (int) spinbuttonTitleX.Value;
		}
		
		/**
		 * OnSpinbuttonTitleYChanged event
		 */
		protected virtual void OnSpinbuttonTitleYChanged (object sender, System.EventArgs e)
		{
			chart.axisY.Title.FontSize = (int) spinbuttonTitleY.Value;
		}
		
		/**
		 * OnSpinbuttonMaxXValueChanged event
		 */
		protected virtual void OnSpinbuttonMaxXValueChanged (object sender, System.EventArgs e)
		{
			chart.axisX.ValueMax = spinbuttonMaxX.Value;
		}
		
		
		/**
		 * OnSpinbuttonMaxYValueChanged event
		 */
		protected virtual void OnSpinbuttonMaxYValueChanged (object sender, System.EventArgs e)
		{
			chart.axisY.ValueMax = spinbuttonMaxY.Value;
		}
	
		/**
		 * OnSpinbuttonMinYValueChanged event
		 */
		protected virtual void OnSpinbuttonMinYValueChanged (object sender, System.EventArgs e)
		{
			chart.axisY.ValueMin = spinbuttonMinY.Value;
		}
	
		/**
		 * OnSpinbuttonMinXValueChanged event
		 */
		protected virtual void OnSpinbuttonMinXValueChanged (object sender, System.EventArgs e)
		{
			chart.axisX.ValueMin = spinbuttonMinX.Value;
		}

		
		/**
		 * OnSpinbuttonLabelXChanged event
		 */
		protected virtual void OnSpinbuttonLabelXChanged (object sender, System.EventArgs e)
		{
			chart.axisX.Labels.FontSize = (int) spinbuttonLabelX.Value;
		}
	
		/**
		 * OnSpinbuttonLabelYChanged event
		 */
		protected virtual void OnSpinbuttonLabelYChanged (object sender, System.EventArgs e)
		{
			chart.axisY.Labels.FontSize = (int) spinbuttonLabelY.Value;
		}

		protected virtual void OnSpinbuttonMaxXChanged (object sender, System.EventArgs e)
		{
		}

		protected virtual void OnSpinbuttonMinXChanged (object sender, System.EventArgs e)
		{
		}

		protected virtual void OnSpinbuttonLabelXValueChanged (object sender, System.EventArgs e)
		{
		}

		
		/**
		 * OnSpinbuttonOffsetLeftValueChanged
		 */
		protected virtual void OnSpinbuttonOffsetLeftValueChanged (object sender, System.EventArgs e)
		{
			chart.OffsetChartLeft = (int) spinbuttonOffsetLeft.Value;
		}

		/**
		 * OnSpinbuttonOffsetRightValueChanged
		 */
		protected virtual void OnSpinbuttonOffsetRightValueChanged (object sender, System.EventArgs e)
		{
			chart.OffsetChartRight = (int) spinbuttonOffsetRight.Value;
		}

		/**
		 * OnSpinbuttonOffsetTopValueChanged
		 */
		protected virtual void OnSpinbuttonOffsetTopValueChanged (object sender, System.EventArgs e)
		{
			chart.OffsetChartTop = (int) spinbuttonOffsetTop.Value;
		}

		/**
		 * OnSpinbuttonOffsetBottomValueChanged
		 */
		protected virtual void OnSpinbuttonOffsetBottomValueChanged (object sender, System.EventArgs e)
		{
			chart.OffsetChartBottom = (int) spinbuttonOffsetBottom.Value;
		}
		
		
	}
}
